﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data;
namespace DuJianliang.ApplicationPlatform.Proj5715.Process
{
    public partial class ExchangePartView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            { 
                if(Request.QueryString["flowInstanceID"]!=null&&Request.QueryString["DispatchMissileID"]!=null)
                {
                    ViewState["flowInstanceID"] = Request.QueryString["flowInstanceID"].Trim();
                    ViewState["DispatchMissileID"] = Request.QueryString["DispatchMissileID"].Trim();

                    string sql = @"SELECT    t5715_ExchangePart.*
                                    FROM         t5715_DispatchMissileProcess INNER JOIN
                                                          t5715_DispatchMissile ON t5715_DispatchMissileProcess.DispatchMissileID = t5715_DispatchMissile.DispatchMissileID INNER JOIN
                                                          t5715_ExchangePart ON t5715_DispatchMissileProcess.DispatchMissileProcessID = t5715_ExchangePart.DispatchMissileProcessRouteID
                                    WHERE     (t5715_DispatchMissile.DispatchMissileID = '"+ViewState["DispatchMissileID"].ToString()+"') ORDER BY exchangedate desc";

                    Database db = DatabaseFactory.CreateDatabase();

                    DataSet ds = db.ExecuteDataSet(CommandType.Text, sql);

                    rpt.DataSource = ds;
                    rpt.DataBind();
                    

                }
                  
            }
        }

 

    
    }
}